package org.example.thread.threadException.example;

import lombok.SneakyThrows;

/**
 * @Auther:Liu
 * @Testname:Customer
 * @Date:2025/8/14 15:22
 */
public class Customer implements Runnable {
    private Broker broker;

    public Customer(Broker broker) {
        this.broker = broker;
    }

    @SneakyThrows
    public  void run() {
        for (int i = 0; i < 20; i++) {
            Goods sell = broker.sell();
            System.out.println("购买了" + sell);
            Thread.sleep(3000);
        }
    }
}
